package com.springmvc.netty.action;

import com.springmvc.utils.JsonUtils;
import com.springmvc.utils.result.ResultMsg;

import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.http.websocketx.TextWebSocketFrame;

public class BaseAction {

	protected void writeAndFlush(ChannelHandlerContext ctx, ResultMsg msg) {
		ctx.channel().writeAndFlush(new TextWebSocketFrame(JsonUtils.obj2JsonString(msg)));
	}
}